﻿/*----------------------------------------------------------------
//文件功能描述：订单对象。
//创建人：赵国伟
//创建时间：2012-03-18 13:49:54
//----------------------------------------------------------------*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Shopping.Common;

namespace Shopping.Model
{
    public class OrderInfo
    {
        /// <summary>
        /// 订单信息；
        /// </summary>
        public Orders Order;

        /// <summary>
        /// 订单明细信息；
        /// </summary>
        public List<OrderLineInfo> Lines;

        /// <summary>
        /// 会员账号；
        /// </summary>
        public string UserName;

        /// <summary>
        /// 订购人区域；
        /// </summary>
        public AreaInfo Area;

        /// <summary>
        /// 商品总金额
        /// </summary>
        public decimal TotalGoodsMoney
        {
            get
            {
                decimal t = 0.00M;
                foreach (OrderLineInfo l in Lines)
                    t += l.LineInfo.Quantity * l.LineInfo.Price * l.LineInfo.Discount;
                return t;
            }
        }



        public OrderInfo()
        {
            this.Order = new Orders();
            this.Order.OrderDate = DateTime.Now;
            this.Lines = new List<OrderLineInfo>();
        }

    }
}
